import { defineStore } from 'pinia'

export const useStore = defineStore('store', {
  state: () => ({
    config: [],
    xmPrice: 1,
    userInfo: {},
    minerInfo: {},
  }),

  actions: {
    setConfig(config = []) {
      this.config = config
    },

    setXmPrice(xmPrice = 1) {
      this.xmPrice = xmPrice
    },

    setUserInfo(userInfo = {}) {
      this.userInfo = userInfo
    },

    setMinerInfo(minerInfo = {}) {
      this.minerInfo = minerInfo
    },
  },
})
